﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace _20.AllVariationsNandK
{
    class AllVariationsNandK
    {
        static void Main(string[] args)
        {
            Console.WriteLine("n of array:");
            int n = 5;

            int[] nnumbers = new int[n];
            for (int i = 0; i < n; i++)
            {
                nnumbers[i] = i + 1;
                Console.WriteLine("numbers[{0}]: {1}", i, i + 1);
            }
            Console.WriteLine("k of array:");
            int k = int.Parse(Console.ReadLine());

            Console.WriteLine("pravilno");


            for (int i = 0; i < nnumbers.Length; i++)
            {
                for (int j = 0; j < nnumbers.Length; j++)
                {
                    Console.Write("( {0} {1} ) ", nnumbers[i], nnumbers[j]);
                }
            }
            Console.WriteLine("pravilno1");
            int[] seq;
            seq = new int[n * n * n];
            int counter = 0;
            for (int i = 0; i < nnumbers.Length; i++)
            {
                for (int j = 0; j < nnumbers.Length; j++, counter += 2)
                {

                    seq[counter] = nnumbers[i];
                    seq[counter + 1] = nnumbers[j];
                }
            }
            Console.WriteLine("pravilno2");

            counter = 0;
            for (int i = 0; i < nnumbers.Length * nnumbers.Length; i++)
            {
                Console.Write(" ( ");
                for (int j = 0; j < k; j++, counter++)
                {
                    Console.Write(" {0} ", seq[counter]);
                }
                Console.Write(" ), ");
            }
         

            
           
            Console.WriteLine("alabala");
            for (int i = 0; i < nnumbers.Length; i++)
            {
                Console.Write("( ");
                for (int j = 0; j < k; j++)
                {
                    Console.Write("{0} ",nnumbers[i]);
                }
                Console.WriteLine(" )");
            }
        }
    }
}
